//
//  BadgeView.h
//  LotteryClient
//
//  Created by Suny on 14-7-5.
//  Copyright (c) 2014年 CTTC. All rights reserved.
//

#import <UIKit/UIKit.h>


typedef NS_ENUM(NSInteger, SYBadgeViewType)
{
    BadgeViewIcon,                        // 图片标记类型
    BadgeViewIconWithText                 // 文字标记类型
};


@interface BadgeView : UIImageView
{
    UILabel      *_textLabel;
    
    BOOL          _hidesWhenNoText;
    BOOL          _autoStrech;
    CGSize        _defaultImageSize;
    UIEdgeInsets  _textLabelInsets;
    
    CGFloat       _maxHeight;
    CGFloat       _maxWidth;
    NSUInteger    _maxNumber;
}

@property (nonatomic, readonly) SYBadgeViewType badgeType;
@property (nonatomic, readonly) UILabel     *textLabel;
@property (nonatomic, assign)   BOOL         hidesWhenNoText;
@property (nonatomic, assign)   CGFloat      maxHeight;
@property (nonatomic, assign)   CGFloat      maxWidth;
@property (nonatomic, assign)   NSUInteger   maxNumber;

- (id)initWithImage:(UIImage *)image;
- (id)initWithImage:(UIImage *)image badgeType:(SYBadgeViewType)badgeType;
- (id)initWithImage:(UIImage *)image badgeType:(SYBadgeViewType)badgeType autoStrech:(BOOL)autoStrech;

- (void)showBadgeWithoutText;
- (void)setBadgeImage:(UIImage *)badgeImage autoStrech:(BOOL)autoStrech;
- (void)setBadgeText:(NSString *)text;
- (void)setBadgeNumber:(NSInteger)number;

- (void)setTextLabelEdgeInsets:(UIEdgeInsets)insets;

@end
